![]() |
Kinetis SDK API Reference Manual
1.0.0-beta
Freescale Semiconductor, Inc.
|
The Kinetis SDK Clock Manager provides a set of API/services to configure the clock-related IPs, such as MCG, SIM, etc. More...
Enumerations | |
| enum | clock_names_t { kCoreClock, kSystemClock, kPlatformClock, kBusClock, kFlexBusClock, kFlashClock, kOsc32kClock, kOsc0ErClock, kOsc1ErClock, kIrc48mClock, kRtc32kClock, kRtc1hzClock, kLpoClock, kMcgFllClock, kMcgPll0Clock, kMcgPll1Clock, kMcgOutClock, kMcgIrClock, kSDHC0_CLKIN, kENET_1588_CLKIN, kEXTAL_Clock, kEXTAL1_Clock, kUSB_CLKIN, kReserved, kClockNameCount } |
| Clock names. | |
| enum | clock_gate_module_names_t { kClockModuleDMA, kClockModuleDMAMUX, kClockModulePORT, kClockModuleMPU, kClockModuleLLWU, kClockModuleEWM, kClockModuleOSC1, kClockModuleFTF, kClockModuleNFC, kClockModuleFLEXBUS, kClockModuleDDR, kClockModuleCRC, kClockModuleRNGA, kClockModuleREGFILE, kClockModuleDRYICESECREG, kClockModuleDRYICE, kClockModuleADC, kClockModuleCMP, kClockModuleDAC, kClockModuleVREF, kClockModuleSAI, kClockModuleTPM, kClockModulePDB, kClockModuleFTM, kClockModulePIT, kClockModuleLPTIMER, kClockModuleCMT, kClockModuleRTC, kClockModuleENET, kClockModuleUSBHS, kClockModuleUSBFS, kClockModuleUSBDCD, kClockModuleFLEXCAN, kClockModuleSPI, kClockModuleI2C, kClockModuleUART, kClockModuleESDHC, kClockModuleLPUART, kClockModuleTSI, kClockModuleLCDC, kClockModuleMax } |
| Clock gate module names. | |
| enum | clock_source_names_t { kClockNfcSrc, kClockEsdhcSrc, kClockSdhcSrc, kClockLcdcSrc, kClockTimeSrc, kClockRmiiSrc, kClockUsbfSrc, kClockUsbSrc, kClockUsbhSrc, kClockUart0Src, kClockTpmSrc, kClockOsc32kSel, kClockUsbfSel, kClockPllfllSel, kClockNfcSel, kClockLcdcSel, kClockTraceSel, kClockClkoutSel, kClockRtcClkoutSel, kClockSourceMax } |
| Clock source and SEL names. | |
| enum | clock_manager_error_code_t { kClockManagerSuccess, kClockManagerNoSuchClockName, kClockManagerNoSuchClockModule, kClockManagerNoSuchClockSource, kClockManagerNoSuchDivider, kClockManagerUnknown } |
| Error code definition for the clock manager APIs. More... | |
Variables | |
| sim_clock_names_t | kClockNameSimMap [kClockNameCount] |
| Clock manager clock names mapping into the SIM clock name. | |
| sim_clock_source_names_t | kClockSourceNameSimMap [kClockSourceMax] |
| Clock manager clock source names mapping into the SIM clock source name. More... | |
| sim_clock_gate_module_names_t | kClockModuleNameSimMap [kClockModuleMax] |
| Clock manager clock module names mapping into the SIM clock module name. | |
| const sim_clock_source_value_t * | kSimClockSourceValueTable [] |
Clock Gating | |
| clock_manager_error_code_t | clock_manager_set_gate (clock_gate_module_names_t moduleName, uint8_t instance, bool enable) |
| Enables or disables the clock for a specific clock module. More... | |
| clock_manager_error_code_t | clock_manager_get_gate (clock_gate_module_names_t moduleName, uint8_t instance, bool *isEnabled) |
| Gets the current clock gate status for a specific clock module. More... | |
Clock Frequencies | |
| clock_manager_error_code_t | clock_manager_get_frequency (clock_names_t clockName, uint32_t *frequency) |
| Gets the clock frequency for a specific clock name. More... | |
| clock_manager_error_code_t | clock_manager_get_frequency_by_source (clock_source_names_t clockSource, uint32_t *frequency) |
| Gets the clock frequency for a specified clock source. More... | |
System out clock access API | |
| uint32_t | clock_hal_get_outclk (void) |
| Gets the current out clock. More... | |
| uint32_t | clock_hal_get_fllclk (void) |
| Gets the current FLL clock. More... | |
| uint32_t | clock_hal_get_pll0clk (void) |
| Gets the current PLL0 clock. More... | |
| uint32_t | clock_hal_get_pll1clk (void) |
| Gets the current PLL1 clock. More... | |
| uint32_t | clock_hal_get_irclk (void) |
| Get the current IR (internal reference) clock. More... | |
| clock_manager_error_code_t clock_manager_set_gate | ( | clock_gate_module_names_t | moduleName, |
| uint8_t | instance, | ||
| bool | enable | ||
| ) |
This function enables/disables the clock for a specified clock module and instance. See the clock_gate_module_names_t for supported clock module names for a specific function and see the Reference Manual for supported clock module name for a specific chip family. Most module drivers call this function to gate(disable)/ungate(enable) the clock for a module. However, the application can also call this function as needed. Disabling the clock causes the module to stop working. See the Reference Manual to properly enable and disable the clock for a device module.
| moduleName | Gate control module name defined in clock_gate_module_names_t |
| instance | Instance of the module |
| enable | Enable or disable the clock for the module
|
| clock_manager_error_code_t clock_manager_get_gate | ( | clock_gate_module_names_t | moduleName, |
| uint8_t | instance, | ||
| bool * | isEnabled | ||
| ) |
This function returns the current clock gate status for a specific clock module. See clock_gate_module_names_t for supported clock module name.
| moduleName | Gate control module name defined in clock_gate_module_names_t |
| instance | Instance of the module |
| isEnabled | Status of the module clock
|
| clock_manager_error_code_t clock_manager_get_frequency | ( | clock_names_t | clockName, |
| uint32_t * | frequency | ||
| ) |
This function checks the current clock configurations and then calculates the clock frequency for a specific clock name defined in clock_names_t. The MCG must be properly configured before using this function. See the Reference Manual for supported clock names for different chip families. The returned value is in Hertz. If it cannot find the clock name or the name is not supported for a specific chip family, it returns an error.
| clockName | Clock names defined in clock_names_t |
| frequency | Returned clock frequency value in Hertz |
| clock_manager_error_code_t clock_manager_get_frequency_by_source | ( | clock_source_names_t | clockSource, |
| uint32_t * | frequency | ||
| ) |
This function gets the specified clock source setting and converts it into a clock name. It calls the internal function to get the value for that clock name. The returned value is in Hertz. If it cannot find the clock source or the source is not supported for the specific chip family, it returns an error.
| clockSource | Clock source names defined in clock_source_names_t |
| frequency | Returned clock frequency value in Hertz |
| uint32_t clock_hal_get_outclk | ( | void | ) |
| none |
| uint32_t clock_hal_get_fllclk | ( | void | ) |
| none |
| uint32_t clock_hal_get_pll0clk | ( | void | ) |
| none |
| uint32_t clock_hal_get_pll1clk | ( | void | ) |
| none |
| uint32_t clock_hal_get_irclk | ( | void | ) |
| none |
| sim_clock_source_names_t kClockSourceNameSimMap[kClockSourceMax] |